<?php

Route::post('/login', 'LoginController@login');

Route::group(['middleware' => ['auth:apiv2']], function () {
    Route::group(['prefix' => 'freight_space'], function () {
        Route::get('/', 'FreightSpaceController@index');
        Route::post('/', 'FreightSpaceController@store');
        Route::get('/{id}', 'FreightSpaceController@edit');
        Route::get('/information/{position}', 'FreightSpaceController@information');
        Route::put('/{id}', 'FreightSpaceController@update');
        Route::delete('/{id}', 'FreightSpaceController@destroy');
    });

    Route::group(['prefix' => 'vendor'], function () {
        Route::get('/', 'VendorController@index');
        Route::post('/', 'VendorController@store');
        Route::get('/{id}', 'VendorController@edit');
        Route::put('/{id}', 'VendorController@update');
        Route::delete('/{id}', 'VendorController@destroy');
    });

    Route::group(['prefix' => 'parts_category'], function () {
        Route::get('/', 'PartsCategoryController@index');
        Route::post('/', 'PartsCategoryController@store');
        Route::get('/{id}', 'PartsCategoryController@edit');
        Route::put('/{id}', 'PartsCategoryController@update');
        Route::delete('/{id}', 'PartsCategoryController@destroy');
    });

    Route::group(['prefix' => 'equipment'], function () {
        Route::get('/', 'EquipmentController@index');
        Route::post('/', 'EquipmentController@store');
        Route::get('/{id}', 'EquipmentController@edit');
        Route::put('/{id}', 'EquipmentController@update');
        Route::delete('/{id}', 'EquipmentController@destroy');
    });

    Route::group(['prefix' => 'parts'], function () {
        Route::get('/', 'PartsController@index');
        Route::get('/create', 'PartsController@create');
        Route::post('/', 'PartsController@store');
        Route::get('/{id}', 'PartsController@edit');
        Route::get('/information/{partsCode}', 'PartsController@information');
        Route::put('/{id}', 'PartsController@update');
        Route::delete('/{id}', 'PartsController@destroy');
    });

    Route::group(['prefix' => 'inventory_management'], function () {
        //获取辅助数据
        Route::get('/listparams', 'InventoryManagementController@listparams');
        //新品入库
        Route::post('/in_warehouse/{id}', 'InventoryManagementController@in_warehouse');
        //领用
        Route::post('/receive/{id}', 'InventoryManagementController@receive');
        //需要修模
        Route::post('/need_repair/{id}', 'InventoryManagementController@need_repair');
        //外出修模
        Route::post('/out_repair/{id}', 'InventoryManagementController@out_repair');
        //报废
        Route::post('/scrap/{id}', 'InventoryManagementController@scrap');
        //申请初次领用审核
        Route::post('/apply_first_audit_receive/{id}', 'InventoryManagementController@apply_first_audit_receive');
        //初次领用审核
        Route::post('/first_audit_receive/{id}', 'InventoryManagementController@first_audit_receive');
        
    });
});

    